//
//  ZWGAnimationTransition.m
//  QuickCure1
//
//  Created by Apple on 16/11/3.
//  Copyright © 2016年 maoge. All rights reserved.
//

#import "ZWGAnimationTransition.h"

static id _instance;
@implementation ZWGAnimationTransition

+(instancetype)sharedAnimationTransition{
    
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        _instance = [[self alloc]init];
    });
    
    return _instance;
}

-(void)addTransitionWithType:(NSString *)type duration:(CGFloat)duration subType:(NSString *const )subType layer:(CALayer *)layer{
    
    
    //创建转场动画
    CATransition *transiton = [CATransition animation];
    
    //设置转场类型
    transiton.type = type;
    
   //设置转场时间
    transiton.duration = 0.5;
    
    //设置转场类型//kCATransitionFromLeft
    transiton.subtype = subType ;
    
    [layer addAnimation:transiton forKey:nil];
    
}


@end
